home *** CD-ROM | disk | FTP | other *** search
- Path: jitter.larc.nasa.gov!lance
- From: lance@jitter.larc.nasa.gov (Michael Lance)
- Newsgroups: comp.lang.c++
- Subject: Explicit copy constructor calls illegal?
- Date: 14 Mar 1996 19:58:32 GMT
- Organization: nasa
- Sender: lance@jitter.larc.nasa.gov ()
- Distribution: world
- Message-ID: <4i9tp8$fgt@reznor.larc.nasa.gov>
- NNTP-Posting-Host: jitter.larc.nasa.gov
-
- Hey!
-
- I am not a C++ newbie, but am feeling like I missed something:
-
- Why can I not make an explicit call to a copy constructor from a class
- member function? To define my terminology, the copy constructor is the
- function:
- MyClass(const MyClass&)
-
- When I try to do this (just trying to re-use code - it is there, why not?),
- a new instance of the class is instantiated SOMEWHERE, but a cout in the
- constructor does NOT reflect it. The copy constructor properly assigns
- the member variables of the instance, and the destructor registers its
- destruction!
-
- Any clues, or am I violating a basic tenet? Lippman 2nd. edition is no
- help here.
-
- By the way, I am using an old version of g++ - 2.6.2, I think, on an
- HP running HP-UX 9.0.5.
-
- Michael B. Lance
- Lockheed Engineering & Sciences
- Hampton, Virginia
-